From 60b6a6898920186c1266b46243cf0cc227612d48 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 8 Nov 2017 15:11:37 +0000 Subject: [PATCH] Lock down /proc/kcore Disallow access to /proc/kcore when the kernel is locked down to prevent access to cryptographic data. Signed-off-by: David Howells Reviewed-by: James Morris Gbp-Pq: Topic features/all/lockdown Gbp-Pq: Name 0025-Lock-down-proc-kcore.patch --- fs/proc/kcore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index d0137e3e585..46365f65511 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -545,6 +545,8 @@ out: static int open_kcore(struct inode *inode, struct file *filp) { + if (kernel_is_locked_down("/proc/kcore")) + return -EPERM; if (!capable(CAP_SYS_RAWIO)) return -EPERM; -- 2.30.2